import publicPage from "../publicPage";

const usersR = {
  path: "/users",
  name: "users",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "users",
    childrenSoft: true,
    children: [
      {
        title: "用户",
        idx: "1",
        children: [
          {
            rtName: "usersList",
            rtTo: "/users/users/list",
            rtTitle: "用户列表"
          }
        ]
      },
      {
        title: "资料",
        idx: "2",
        children: [
          {
            rtName: "dataDataSet",
            rtTo: "/users/data/dataSet",
            rtTitle: "字段设置"
          },
          {
            rtName: "dataRewardSet",
            rtTo: "/users/data/rewardSet",
            rtTitle: "奖励设置"
          },
          {
            rtName: "dataBlackList",
            rtTo: "/users/data/blackList",
            rtTitle: "黑名单"
          }
        ]
      },
      {
        title: "资产管理",
        idx: "3",
        children: [
          {
            rtName: "assetsIntegral",
            rtTo: "/users/assets/integral",
            rtTitle: "积分设置"
          },
          {
            rtName: "assetsStored",
            rtTo: "/users/assets/stored",
            rtTitle: "储值管理"
          },
          {
            rtName: "assetsDeduction",
            rtTo: "/users/assets/deduction",
            rtTitle: "抵扣金设置"
          }
        ]
      }
    ]
  },
  redirect: "/users/users/list",
  children: [
    {
      path: "/users/users/list",
      name: "usersList",
      component: r =>
        require.ensure([], () => r(require("shop/users/list")), "users")
    },
    {
      path: "/users/data/dataSet",
      name: "dataDataSet",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/udata/dataSet")),
          "users"
        )
    },
    {
      path: "/users/data/rewardSet",
      name: "dataRewardSet",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/udata/rewardSet")),
          "users"
        )
    },
    {
      path: "/users/data/blackList",
      name: "dataBlackList",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/udata/blackList")),
          "users"
        )
    },
    {
      path: "/users/assets/integral",
      name: "assetsIntegral",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/uassets/integral")),
          "users"
        )
    },
    {
      path: "/users/assets/stored",
      name: "assetsStored",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/uassets/stored")),
          "users"
        )
    },
    {
      path: "/users/assets/deduction",
      name: "assetsDeduction",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/users/uassets/deduction")),
          "users"
        )
    }
  ]
};

const storesR = {
  path: "/stores",
  name: "stores",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "stores",
    childrenSoft: true,
    children: [
      {
        title: "门店",
        idx: "1",
        children: [
          {
            rtName: "storesList",
            rtTo: "/stores/stores/list",
            rtTitle: "门店列表"
          },
          {
            rtName: "storesLabel",
            rtTo: "/stores/stores/label",
            rtTitle: "门店标签"
          }
          // {
          //   rtName: "storesLimit",
          //   rtTo: "/stores/stores/limit",
          //   rtTitle: "门店权限"
          // },
          // {
          //   rtName: "storesNotice",
          //   rtTo: "/stores/stores/notice",
          //   rtTitle: "消息通知"
          // }
        ]
      }
    ]
  },
  redirect: "/stores/stores/list",
  children: [
    {
      path: "/stores/stores/list",
      name: "storesList",
      component: r =>
        require.ensure([], () => r(require("shop/stores/list")), "stores")
    },
    {
      path: "/stores/stores/label",
      name: "storesLabel",
      component: r =>
        require.ensure([], () => r(require("shop/stores/label")), "stores")
    },
    {
      path: "/stores/stores/limit",
      name: "storesLimit",
      component: r =>
        require.ensure([], () => r(require("shop/stores/limit")), "stores")
    },
    {
      path: "/stores/stores/notice",
      name: "storesNotice",
      component: r =>
        require.ensure([], () => r(require("shop/stores/notice")), "stores")
    }
  ]
};

const goodsR = {
  path: "/goods",
  name: "goods",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "goods",
    childrenSoft: true,
    children: [
      {
        title: "商品",
        idx: "1",
        children: [
          {
            rtName: "goodsList",
            rtTo: "/goods/goods/list",
            rtTitle: "商品列表"
          },
          {
            rtName: "goodsClass",
            rtTo: "/goods/goods/class",
            rtTitle: "商品分类"
          }
        ]
      }
    ]
  },
  redirect: "/goods/goods/list",
  children: [
    {
      path: "/goods/goods/list",
      name: "goodsList",
      component: r =>
        require.ensure([], () => r(require("shop/goods/list")), "goods")
    },
    {
      path: "/goods/goods/Class",
      name: "goodsClass",
      component: r =>
        require.ensure([], () => r(require("shop/goods/class")), "goods")
    }
  ]
};

const orderR = {
  path: "/order",
  name: "order",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "order",
    childrenSoft: true,
    children: [
      {
        title: "订单",
        idx: "1",
        children: [
          {
            rtName: "orderAllList",
            rtTo: "/order/list/all",
            rtTitle: "全部订单"
          },
          {
            rtName: "orderStoredList",
            rtTo: "/order/list/stored",
            rtTitle: "储值订单"
          },
          {
            rtName: "orderDistributionList",
            rtTo: "/order/list/distribution",
            rtTitle: "分销订单"
          }
        ]
      },
      {
        title: "管理",
        idx: "2",
        children: [
          {
            rtName: "manageDelivery",
            rtTo: "/order/manage/delivery",
            rtTitle: "发货管理"
          },
          {
            rtName: "manageSince",
            rtTo: "/order/manage/since",
            rtTitle: "自提管理"
          },
          {
            rtName: "manageDealWith",
            rtTo: "/order/manage/dealWith",
            rtTitle: "订单处理"
          }
        ]
      },
      {
        title: "设置",
        idx: "3",
        children: [
          {
            rtName: "setDownSingle",
            rtTo: "/order/set/downSingle",
            rtTitle: "下单设置"
          },
          {
            rtName: "setProcess",
            rtTo: "/order/set/process",
            rtTitle: "流程设置"
          },
          {
            rtName: "setMaintain",
            rtTo: "/order/set/maintain",
            rtTitle: "维权设置"
          },
          {
            rtName: "setComments",
            rtTo: "/order/set/comments",
            rtTitle: "评论设置"
          }
        ]
      }
    ]
  },
  redirect: "/order/list/all",
  children: [
    {
      path: "/order/list/all",
      name: "orderAllList",
      component: r =>
        require.ensure([], () => r(require("shop/order/list/all")), "order")
    },
    {
      path: "/order/list/stored",
      name: "orderStoredList",
      component: r =>
        require.ensure([], () => r(require("shop/order/list/stored")), "order")
    },
    {
      path: "/order/list/distribution",
      name: "orderDistributionList",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/order/list/distribution")),
          "order"
        )
    },
    // {
    //   path: "/order/order/storedList",
    //   name: "orderStoredList",
    //   component: r =>
    //     require.ensure([], () => r(require("shop/order/orderList")), "order")
    // },
    {
      path: "/order/manage/delivery",
      name: "manageDelivery",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/order/manage/delivery")),
          "order"
        )
    },
    {
      path: "/order/manage/since",
      name: "manageSince",
      component: r =>
        require.ensure([], () => r(require("shop/order/manage/since")), "order")
    },
    {
      path: "/order/manage/dealWith",
      name: "manageDealWith",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/order/manage/dealWith")),
          "order"
        )
    },
    {
      path: "/order/set/downSingle",
      name: "setDownSingle",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/order/set/downSingle")),
          "order"
        )
    },
    {
      path: "/order/set/process",
      name: "setProcess",
      component: r =>
        require.ensure([], () => r(require("shop/order/set/process")), "order")
    },
    {
      path: "/order/set/maintain",
      name: "setMaintain",
      component: r =>
        require.ensure([], () => r(require("shop/order/set/maintain")), "order")
    },
    {
      path: "/order/set/comments",
      name: "setComments",
      component: r =>
        require.ensure([], () => r(require("shop/order/set/comments")), "order")
    }
  ]
};

const vipCardR = {
  path: "/vipCard",
  name: "vipCard",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "vipCard",
    childrenSoft: true,
    children: [
      {
        title: "会员",
        idx: "1",
        children: [
          {
            rtName: "vipCard",
            rtTo: "/vip/card",
            rtTitle: "会员卡列表"
          }
        ]
      },
      {
        title: "权益",
        idx: "2",
        children: [
          {
            rtName: "vipPrivilege",
            rtTo: "/vip/privilege",
            rtTitle: "会员权益"
          }
        ]
      }
    ]
  },
  redirect: "/vip/card",
  children: [
    {
      path: "/vip/card",
      name: "vipCard",
      component: r =>
        require.ensure([], () => r(require("shop/vipCard/card")), "vipCard")
    },
    {
      path: "/vip/privilege",
      name: "vipPrivilege",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/vipCard/privilege")),
          "vipCard"
        )
    }
  ]
};

const sendR = {
  path: "/send",
  name: "send",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "send",
    childrenSoft: true,
    children: [
      {
        title: "商家配送",
        idx: "1",
        children: [
          {
            rtName: "merchantTemplate",
            rtTo: "/send/merchant/template",
            rtTitle: "运费模板"
          },
          {
            rtName: "merchantSet",
            rtTo: "/send/merchant/set",
            rtTitle: "配送设置"
          }
        ]
      },
      {
        title: "同城配送",
        idx: "2",
        children: [
          {
            rtName: "sameCitySet",
            rtTo: "/send/sameCity/set",
            rtTitle: "配送设置"
          }
        ]
      },
      {
        title: "到店自提",
        idx: "3",
        children: [
          {
            rtName: "inviteManage",
            rtTo: "/send/invite/manage",
            rtTitle: "自提点管理"
          },
          {
            rtName: "inviteSet",
            rtTo: "/send/invite/set",
            rtTitle: "自提设置"
          }
        ]
      },
      {
        title: "地址库",
        idx: "4",
        children: [
          {
            rtName: "addressLibraryList",
            rtTo: "/send/addressLibrary/list",
            rtTitle: "地址库"
          }
        ]
      }
      // {
      //   rtName: "addressLibrary",
      //   rtTo: "/send/addressLibrary",
      //   rtTitle: "订单自定义字段"
      // }
    ]
  },
  redirect: "/send/merchant/template",
  children: [
    {
      path: "/send/merchant/template",
      name: "merchantTemplate",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/send/merchant/freight")),
          "send"
        )
    },
    {
      path: "/send/merchant/set",
      name: "merchantSet",
      component: r =>
        require.ensure([], () => r(require("shop/send/merchant/set")), "send")
    },
    {
      path: "/send/sameCity/set",
      name: "sameCitySet",
      component: r =>
        require.ensure([], () => r(require("shop/send/sameCity/set")), "send")
    },
    {
      path: "/send/sameCity/logistics",
      name: "logistics",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/send/sameCity/logistics")),
          "send"
        )
    },
    {
      path: "/send/invite/manage",
      name: "inviteManage",
      component: r =>
        require.ensure([], () => r(require("shop/send/invite/manage")), "send")
    },
    {
      path: "/send/invite/set",
      name: "inviteSet",
      component: r =>
        require.ensure([], () => r(require("shop/send/invite/set")), "send")
    },
    {
      path: "/send/addressLibrary/list",
      name: "addressLibraryList",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/send/addressLibrarys")),
          "send"
        )
    }
  ]
};

const shopSettingR = {
  path: "/shopSetting",
  name: "shopSetting",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "shopSetting",
    childrenSoft: true,
    children: [
      {
        title: "设置",
        idx: "1",
        children: [
          {
            rtName: "paySetting",
            rtTo: "/shopSetting/paySetting",
            rtTitle: "支付设置"
          }
        ]
      }
    ]
  },
  redirect: "/shopSetting/paySetting",
  children: [
    {
      path: "/shopSetting/paySetting",
      name: "paySetting",
      component: r =>
        require.ensure(
          [],
          () => r(require("shop/shopSetting/paySetting")),
          "shopSetting"
        )
    }
  ]
};

const wxR = {
  path: "/wx",
  name: "wx",
  component: r =>
    require.ensure([], () => r(require("comMain/AsideT")), "AsideT"),
  meta: {
    name: "wx",
    childrenSoft: true,
    children: [
      {
        title: "微信",
        idx: "1",
        children: [
          { rtName: "wxchat", rtTo: "/wxchat", rtTitle: "授权" },
          { rtName: "updates", rtTo: "/updates", rtTitle: "更新" },
          { rtName: "root", rtTo: "/root", rtTitle: "预览" },
          { rtName: "fabu", rtTo: "/fabu", rtTitle: "发布" }
        ]
      }
    ]
  },
  redirect: "/wxchat",
  children: [
    {
      path: "/wxchat",
      name: "wxchat",
      component: r =>
        require.ensure([], () => r(require("publicPage/wx/Wechat")), "wx")
    },
    {
      path: "/updates",
      name: "updates",
      component: r =>
        require.ensure([], () => r(require("publicPage/wx/updates")), "wx")
    },
    {
      path: "/root",
      name: "root",
      component: r =>
        require.ensure([], () => r(require("publicPage/wx/root")), "wx")
    },
    {
      path: "/fabu",
      name: "fabu",
      component: r =>
        require.ensure([], () => r(require("publicPage/wx/fabu")), "wx")
    }
  ]
};
export default {
  path: "/home",
  meta: "main",
  component: r =>
    require.ensure([], () => r(require("@/views/main/home")), "main"),
  children: [
    publicPage.overviewPageR,
    publicPage.marketR,
    publicPage.decorateR,
    publicPage.articleR,
    publicPage.wifiR,
    publicPage.printerSetR,
    publicPage.videoR,
    publicPage.smashEggR,
    publicPage.spellGroupR,
    publicPage.limitR,
    publicPage.distributionR,
    publicPage.zeroYuanR,
    publicPage.couponsR,
    publicPage.siginR,
    publicPage.bargainR,
    publicPage.prizeR,
    usersR,
    goodsR,
    storesR,
    orderR,
    vipCardR,
    sendR,
    wxR,
    shopSettingR
  ]
};
